<h1>Edit Instances</h1>

<form name="adminForm" id="adminForm" action="<?php echo JRoute::_('index.php?option=com_easiv2'); ?>" method="post">
<table class="adminlist">
	<thead>
		<tr>
			<th>ID</th>
			<th>Name</th>
			<th>HTTP-Address</th>
			<th>FTP-Host</th>
			<th>FTP-Port</th>
			<th>Host Folder</th>
			<th>FTP Username</th>
			<th>FTP Password</th>
		</tr>
	</thead>
	<tbody>
		<?php
			$db =& JFactory::getDBO();
			
			foreach($this->idsToEdit as $id) {
				$db->setQuery("SELECT * FROM #__easiv2_instances WHERE id='".$id."'");
				$instance = $db->loadObject();
				
				echo "<tr>";
					echo "<td align=\"center\"><input type=\"hidden\" name=\"id[]\" value=\"".$id."\" />".$id."</td>";
					echo "<td align=\"center\"><input type=\"text\" name=\"".$id."_name\" value=\"".$instance->name."\"></td>";
					echo "<td align=\"center\"><input type=\"text\" name=\"".$id."_http\" value=\"".$instance->http_address."\"></td>";
					echo "<td align=\"center\"><input type=\"text\" name=\"".$id."_ftp\" value=\"".$instance->ftp_host."\" /></td>";
					echo "<td align=\"center\"><input type=\"text\" name=\"".$id."_port\" value=\"".$instance->ftp_port."\" /></td>";
					echo "<td align=\"center\"><input type=\"text\" name=\"".$id."_folder\" value=\"".$instance->host_folder."\" /></td>";
					echo "<td align=\"center\"><input type=\"text\" name=\"".$id."_user\" value=\"".$instance->ftp_user."\" /></td>";
					echo "<td align=\"center\"><input type=\"password\" name=\"".$id."_pass\"  value=\"\" /></td>";
				echo "</tr>";
			}
		?>
	</tbody>
</table>
<input type="hidden" name="task" value="" />
</form>